package com.jp.refreshlocalcachedemo;

import com.jp.refreshlocalcachedemo.service.ServiceA;
import com.jp.refreshlocalcachedemo.service.ServiceB;
import com.jp.refreshlocalcacheserver.aspect.RefreshLocalCacheAspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class RefreshLocalCacheDemoApplication {



    public static void main(String[] args) {
        ApplicationContext app = SpringApplication.run(RefreshLocalCacheDemoApplication.class, args);


        Thread t = new Thread( () ->{
            try {
                Thread.sleep(10000);
                ServiceB b = app.getBean(ServiceB.class);

                b.test1();
            }catch (Exception e){

            }
        });

        t.start();
    }

}
